package com.hankol.feature_wine_meal.view;

import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;

import androidx.annotation.Nullable;

import com.hankol.feature_wine_meal.R;
import com.hankol.feature_wine_meal.bean.FoodDetailsBean;

/**
 * @author: 关忆北、
 * @date: 2022/6/22
 * @Des：
 */
public class DifficultyLevelView extends LinearLayout {

    private View viewDifficultyLeve;
    private TextView mTvLeveDifficulty;
    private TextView mTvLeveCook;
    private TextView mTvLeveTaste;
    private TextView mTvLeveTime;

    public DifficultyLevelView(Context context) {
        super(context);
        initView();
    }

    public DifficultyLevelView(Context context, @Nullable AttributeSet attrs) {
        super(context, attrs);
        initView();
    }

    public DifficultyLevelView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        initView();
    }

    private void initView() {
        viewDifficultyLeve = LayoutInflater.from(getContext()).inflate(R.layout.view_difficulty_leve, this);
        mTvLeveDifficulty = (TextView) findViewById(R.id.tv_leve_difficulty);
        mTvLeveCook = (TextView) findViewById(R.id.tv_leve_cook);
        mTvLeveTaste = (TextView) findViewById(R.id.tv_leve_taste);
        mTvLeveTime = (TextView) findViewById(R.id.tv_leve_time);
    }

    public void setData(FoodDetailsBean bean) {
        mTvLeveDifficulty.setText(bean.getNanYiDu());
        mTvLeveCook.setText(bean.getGongYi());
        mTvLeveTaste.setText(bean.getKouWei());
        mTvLeveTime.setText(bean.getCookTime());

    }
}
